Importing the Gnu Multiple Precision Package (GMP) into Lisp, and implications for Functional Programming
نویسنده
چکیده
Advocating the use of a Common Lisp as a central organizing environment for building scientific computing systems runs counter to the conventional wisdom, which suggests that languages like Fortran, C++, or even Java, are more suitable. We prefer Lisp based on its debugging features, interactivity, memory model, existing code-base for computer algebra and user interfaces, and for purposes of this paper, its ability to dynamically load modules written in other languages. GMP is an open-source highly-tuned library of programs for arbitrary precision integer, rational and floating-point arithmetic. It is easy to use it from Common Lisp in some ways but used in its most efficient form GMP conflicts with the dominant (functional) model of arithmetic in Lisp and similar languages. GMP may also require a delicate touch to interface with the storage allocation mechanisms in its host language (Lisp’s garbage collector). We discuss both these issues.
منابع مشابه
Importing Pre-packaged Software into Lisp: Experience with Arbitrary-Precision Floating-Point Numbers
We advocate the use of a Common Lisp as a central organizing environment for building scientific computing systems, based on its debugging features, interactivity, memory model, existing code-base for computer algebra and user interfaces, and its ability to dynamically load modules written in other languages. In this paper we primarily address one example of mixing pre-existing (non Lisp) code ...
متن کاملArbitrarily Accurate Computation with R: The Rmpfr Package
The R package Rmpfr allows to use arbitrarily precise numbers instead of R’s double precision numbers in many R computations and functions. This is achieved by defining S4 classes of such numbers and vectors, matrices, and arrays thereof, where all arithmetic and mathematical functions work via the (GNU) MPFR C library, where MPFR is acronym for“Multiple Precision Floating-Point Reliably”. MPFR...
متن کاملHow to Get an Efficient yet Verified Arbitrary-Precision Integer Library
The GNU Multi-Precision library is a widely used, safetycritical, library for arbitrary-precision arithmetic. Its source code is written in C and assembly, and includes intricate state-of-the-art algorithms for the sake of high performance. Formally verifying the functional behavior of such highly optimized code, not designed with verification in mind, is challenging. We present a fully verifie...
متن کاملFast inverse for big numbers: Picarte’s iteration
This paper presents an algorithm to compute the inverse of an n-bit integer with k ≥ n bits of precision running in time O(M(k, n)), where M(k, n) is the time needed to multiply two numbers of k and n bits. This bound improves asymptotically Newton’s iteration in this range which gives O(M(k, k)), and hence improves asymptotically the best known upper bound for computing the inverse with high p...
متن کاملA high-performance software package for semidefinite programs: SDPA 7
The SDPA (SemiDefinite Programming Algorithm) Project launched in 1995 has been known to provide high-performance packages for solving large-scale Semidefinite Programs (SDPs). SDPA Ver. 6 solves efficiently large-scale dense SDPs, however, it required much computation time compared with other software packages, especially when the Schur complement matrix is sparse. SDPA Ver. 7 is now completel...
متن کامل